package cn.iocoder.yudao.module.trade.controller.admin.order.vo;

import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.module.trade.controller.admin.base.member.user.MemberUserRespVO;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;


import java.util.List;

@Schema(description = "管理后台 - 交易订单的分页项 Response VO")
@Data
public class TradeOrderPageItemRespVO extends TradeOrderBaseVO {

    @Schema(description = "收件人地区名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "上海 上海市 普陀区")
    private String receiverAreaName;

    @Schema(description = "订单项列表", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<Item> items;

    @Schema(description = "用户信息", requiredMode = Schema.RequiredMode.REQUIRED)
    private MemberUserRespVO user;

    @Schema(description = "推广人信息")
    private MemberUserRespVO brokerageUser;

    @Schema(description = "是否能催单",example = "false")
    private Boolean ifTryReminder = true;

    @Schema(description = "燃气号",example = "123")
    private String code;
    /**
     * 姓名
     */
    @Schema(description = "姓名",example = "张三")
    private String name;

    @Schema(description = "联系方式",example = "13302020222")
    private String mobile;
    /**
     * 详细地址
     */
    @Schema(description = "详细地址",example = "湖北")
    private String detailAddress;
    /**
     * 燃气户类型0 民 1商 2工
     */
    @Schema(description = "燃气户类型",example = "工")
    private String accountType;

    @Schema(description = "订单状态值",example = "待发货")
    private String statusStr;

    @Schema(description = "管理后台 - 交易订单的分页项的订单项目")
    @Data
    public static class Item extends TradeOrderItemBaseVO {


    }

    public String getStatusStr() {
        if(super.getStatus() != null){
            return TradeOrderStatusEnum.getName(super.getStatus());
        }
        return statusStr;
    }
}
